package com.lp.sys.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RegisterMapper {
    @Select("SELECT COUNT(*) FROM sys_user WHERE loginname = #{loginname}")
    boolean existsByLoginname(@Param("loginname") String loginname);

    @Insert("INSERT INTO sys_user (loginname, pwd, name, salt ,type) VALUES (#{loginname}, #{pwd}, #{name}, #{salt}, #{type})")
    int insertUser(@Param("loginname") String loginname,
                   @Param("pwd") String pwd,
                   @Param("name") String name,
                   @Param("salt") String salt,
                   @Param("type") Integer type);
}
